<template>
  <div class="student">
    <h2>姓名：{{ name }}</h2>
    <h2>年龄：{{ age }}</h2>
    <h2>性别：{{ gender }}</h2>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "张三",
      age: 12,
      gender: "男",
    };
  },
  methods: {},
  mounted() {
    this.$bus.$emit("get-student-name", this.name);
  },
};
</script>

<!-- yarn add -D sass -->
<style scoped lang="scss">
.student {
  background: skyblue;
  margin: 3rem 0 3rem 0;
  padding: 1rem;
}
</style>
